﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace WebMobie.Models.Entities
{
	public class OrderDetail
	{
		[ScaffoldColumn(false)]
		public int Id { get; set; }
		public int ProductId { get; set; }
		public Product Product { get; set; }
		public Order Order { get; set; }
		public int Quantity { get; set; }
		public long UnitCost { get; set; }
		public long SubTotal { get; set; }

        public void autoCountTotal()
        {
            this.SubTotal = this.Quantity * this.UnitCost;
        }

	}
}